<div class="content" fxLayout="row" fxLayoutAlign="center">

    <md-card elevation="5" fxFlex>

      <md-card-subtitle>
        <h2>Angular2 Spring Boot JWT Starter</h2>
      </md-card-subtitle>

      <md-card-title>
        <h2>{{title}}</h2>
      </md-card-title>

      <md-card-content>

        <form *ngIf="!submitted" [formGroup]="form" (ngSubmit)="onSubmit()" #loginForm="ngForm">
          <md-input-container>
            <input mdInput formControlName="username" required placeholder="user/admin">
          </md-input-container>
          <md-input-container>
            <input mdInput formControlName="password" required type="password" placeholder="123">
          </md-input-container>
          <button type="submit" [disabled]="!loginForm.form.valid" md-raised-button color="primary">Login</button>
        </form>

        <md-spinner *ngIf="submitted" mode="indeterminate"></md-spinner>

        <p class="error" *ngIf="errorDiagnostic">{{errorDiagnostic}}</p>

        <br>
        <hr>

        <p><i>Created by <a href="https://github.com/bfwg">Fan Jin</a></i></p>
        <p><i>Click below to go to repository</i></p>
        <button (click)="repository()" md-raised-button color="accent">GitHub Repository</button>

      </md-card-content>

    </md-card>

</div>
